<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<% String path=request.getContextPath();
pageContext.setAttribute("path", path);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
 <link href="${path }/admin/js/bstable/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="${path }/admin/js/bstable/css/bootstrap-table.css" rel="stylesheet" type="text/css">
    <link href="${path }/admin/css/table.css" rel="stylesheet" type="text/css" />
    <link href="${path }/admin/css/news.css" rel="stylesheet" type="text/css" />
</head>
</head>
<body style="background-color: #ecf0f5;font-family: 微软雅黑;color: #475059;min-width: 1000px;overflow: auto">
<div class="l_left news_right">
        <h6>类别管理</h6>
		<form action="${path }/AdminSelectCatalogServlet" method="get">
        <div class="notice_check">
            <div class="btn-group l_left" style="margin-right: 4px">
                <p>请输入编号：</p>
                
            </div>
            <div class="l_left">
                <input type="text" name="key" class="find_input">

            </div>
            <button class="check_btn">查询</button>
            <div class="notice_nav r_right">
                <a class="btn btn-default" onclick="addLog()"><span class="glyphicon glyphicon-plus"></span>新增</a>

            </div>
            <div class="clear"></div>
        </div>
        </form>
        <ul class="news_table">
            <li>
                <table class="table_style  table table-hover table-striped"  >
                <thead>
                        <tr>
                            <th><h4>编号</h4></th>
                            <th><h4>类别</h4></th>
                            <th><h4>父编号</h4></th>
                            <th><h4>操作</h4></th>

                        </tr>
                    </thead>
                <tbody id="road">
                	<c:forEach items="${catalogs }" var="s">
								<tr>
									<td>${s.id }</td>
									<td>${s.title }</td>
									<td>${s.parent_id }</td>

									 <td class="td-manage"><a class="lafitewu_look" title="修改" onclick=""
											href="SelectCatalogByIdServlet?id=${s.id }"> 修改 </a> 
											<a class="lafitewu_auditing lafitewu_margin_left_20" title="审核"
											onclick="return  confirm('是否真的删除？')" href="AdminDeleteCatalogServlet?id=${s.id }">
												删除 </a></td> 
								</tr>
						</c:forEach>
				</tbody>
				</table>
            </li>
           <!--  <li style="display: none">
                <table id="table1" class="table_style" style="margin: 0 auto" ></table>
            </li>
            <li style="display: none">
                <table id="table2" class="table_style" style="margin: 0 auto" ></table>
            </li> -->
        </ul>

    </div>
    <div class="clear"></div>

</div>
<script src="${path }/admin/js/jquery/jQuery-2.2.0.min.js"></script>
<script src="${path }/admin/js/bstable/js/bootstrap.min.js"></script>
<script src="${path }/admin/js/bstable/js/bootstrap-table.js"></script>
<script src="${path }/admin/js/bstable/js/bootstrap-table-zh-CN.min.js"></script>
<script src="${path }/admin/js/layer_v2.1/layer/layer.js"></script>
<script>
    $(function(){
        table();
        nav();
        change();
    });
    function change(){
        $(".dropdown-menu>li").click(function(){
            $(".change").html($(this).html())
        })
    }
    function nav(){
        $(".log_nav li").each(function(index){
            $(this).click(function(){
                $(".log_nav li").removeClass("log_active");
                $(this).addClass("log_active");
                $(".news_table>li").eq(index).show().siblings("li").stop().hide();
            })

        })
    }
    function table(){
        $('#table').bootstrapTable({
            method: "get",
            striped: true,
            singleSelect: false,
            url: "#",
            dataType: "json",
            pagination: true, //分页
            pageSize: 10,
            pageNumber: 1,
            search: false, //显示搜索框
            contentType: "application/x-www-form-urlencoded",
            queryParams: null,
            columns: [
                {
                    checkbox: "true",
                    field: 'check',
                    align: 'center',
                    valign: 'middle'
                }
                ,
                {
                    title: "编号",
                    field: 'id',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '类别',
                    field: 'title',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '操作用户',
                    field: 'person',
                    align: 'center',
                    valign: 'middle'
                },
               
            ]
        });
        
    }
    function delLog(){
        layer.open({
            type: 2,
            title: '清空登录日志',
            shade: 0.5,
            skin: 'layui-layer-rim',
            area: ['362px', '200px'],
            shadeClose: true,
            closeBtn: 1,
            content: 'log_tail.html'
        })
    }
    function addLog(){
        layer.open({
            type: 2,
            title: '添加类别',
            shade: 0.5,
            skin: 'layui-layer-rim',
            area: ['480px', '290px'],
            shadeClose: true,
            closeBtn: 1,
            content: '${path}/admin/addcatalog.jsp'
        })
    }
</script>
</body>
</html>